home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / Pascal OS8 / AMReminder / AMReminderEngine.p < prev    next >
Encoding:
Text File  |  1998-10-30  |  2.3 KB  |  124 lines  |  [TEXT/CWIE]

  1. { AMReminderEngine.p -- application-specific data management }
  2. { Created 10/30/98 1:03 PM by AppMaker }
  3.  
  4. { This module contains data structures to access the data in your }
  5. { document's file(s). The purpose is to isolate the details of the }
  6. { data representation into this module and to provide accessor }
  7. { functions for reading/writing logical pieces of the data. }
  8. { For your application, you will probably rewrite most of this. }
  9. { This module will not be regenerated by AppMaker unless you delete it. }
  10.  
  11. Unit AMReminderEngine;
  12. Interface
  13.  
  14. Uses
  15.     Types,
  16.     Quickdraw,
  17.     Controls,
  18.     Events,
  19.     Files,
  20.     Lists,
  21.     Menus,
  22.     DReminder,
  23.     DDocData,
  24.     TextEdit,
  25.     AMEngine;
  26.  
  27. const
  28.     kSignature        = 'XXXX';
  29.     kFileType        = 'TEXT';
  30.  
  31. type
  32.     AMReminderEngine        = object (AMEngine)
  33.  
  34.     {data members}
  35.  
  36.     {methods - public}
  37.         Procedure Initialize; Override;
  38.  
  39.         Function  GetReminder: DReminder;
  40.         Function  GetDocData: DDocData;
  41.  
  42.     {methods - internal}
  43.         Procedure InitData; Override;
  44.         Procedure DisposeData; Override;
  45.         Procedure ReadFile; Override;
  46.         Procedure WriteFile; Override;
  47.     end;
  48.  
  49. {----------}
  50. Function NewAMReminderEngine: AMReminderEngine;
  51.  
  52. {----------}
  53. Implementation
  54.  
  55. Uses
  56.     Globals,
  57.     Miscellany;
  58.  
  59. {----------}
  60. Function NewAMReminderEngine: AMReminderEngine;
  61. var
  62.     engine:        AMReminderEngine;
  63. begin
  64.     New (engine);
  65.     if engine <> nil then begin
  66.         engine.Initialize;
  67.     end;
  68.     NewAMReminderEngine := engine;
  69. end;
  70.  
  71. {----------}
  72. Procedure AMReminderEngine.Initialize;
  73. begin
  74.     inherited Initialize;
  75.  
  76.     mFileType := kFiletype;
  77.     mSignature := kSignature;
  78. end;
  79.  
  80. { These are just models for your own data access functions. }
  81. { Replace them with ones that do something useful. }
  82.  
  83. {----------}
  84. Function AMReminderEngine.GetReminder: DReminder;
  85. begin
  86.     GetReminder := NewDReminder;
  87. end;
  88.  
  89. {----------}
  90. Function AMReminderEngine.GetDocData: DDocData;
  91. begin
  92.     GetDocData := NewDDocData;
  93. end;
  94.  
  95.  
  96. {----------}
  97. Procedure AMReminderEngine.InitData;
  98. begin
  99.     {override to initialize your data structures}
  100. end;
  101.  
  102. {----------}
  103. Procedure AMReminderEngine.DisposeData;
  104. begin
  105.     {override to dispose your data structures}
  106. end;
  107.  
  108. {----------}
  109. Procedure AMReminderEngine.ReadFile;
  110. begin
  111.     InitData;
  112.     mDirty := false;
  113.     {override to read from the current file into your data structures}
  114. end;
  115.  
  116. {----------}
  117. Procedure AMReminderEngine.WriteFile;
  118. begin
  119.     mDirty := false;
  120.     {override to write your data structures to the current file}
  121. end;
  122.  
  123. end.
  124.